@extends('layouts.app')

@section('title','EditMaster')

@section('content')
    <div class="container">
        <div class="row">
            <div class="col-md-8 col-md-offset-2 create-question">
                <div class="panel panel-default">
                    <div class="panel-heading">编辑大师</div>
                    <div class="panel-body">
                        {!! Form::model($master, ['action' => ['MasterController@update',$master->id], 'files' => true]) !!}
                        <input name="_method" type="hidden" value="PATCH">
                        {{ csrf_field() }}
                        <div class="form-group{{ $errors->has('master_name')?'has-error':'' }}">
                            {!! Form::label('master_name','大师名')!!}
                            {!! Form::text('master_name',$master->master_name,['class'=>'form-control'])!!}
                            @if ($errors->has('master_name'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('master_name') }}</strong>
                                </span>
                            @endif
                        </div>
                        <div class="form-group">
                            {!! Form::label('master_avatar','大师头像')!!}
                            <div class="input-group">
                                <img src="/uploads/avatars/{{ $master->master_avatar }}"/>
                                {!! Form::file('master_avatar'); !!}
                                @if ($errors->has('master_avatar'))
                                    <div class="help-block">
                                        <strong>{{ $errors->first('master_avatar') }}</strong>
                                    </div>
                                @endif
                            </div>
                        </div>
                        <div class="form-group{{ $errors->has('master_intro')?'has-error':'' }}">
                            {!! Form::label('master_intro','个人简介') !!}
                            <div class="input-group">
                                {!! Form::textarea('master_intro',$master->master_intro) !!}
                                @if ($errors->has('master_intro'))
                                    <span class="help-block">
				                        <strong>{{ $errors->first('master_intro') }}</strong>
				                    </span>
                                @endif
                            </div>
                        </div>
                        {!! Form::submit('更新大师信息',['class'=>"btn btn-success"]); !!}
                        {!! Form::close() !!}
                    </div>
                    <div id="debug"></div>
                </div>
            </div>
        </div>
    </div>

@endsection